home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2001 March / macformat-101.iso / mac / Demos / SolidThinking 4 / Help / ehlpdht7.js < prev    next >
Encoding:
JavaScript  |  2000-09-06  |  31.5 KB  |  1,017 lines  |  [TEXT/dosa]

  1. /// Section Begin  - CCSSP DHTM 2 (JavaScript 1.2)
  2. // eHelpÆ Corporation Dynamic HTML JavaScript 
  3. // Copyright© 1998-2000 eHelpÆ Corporation.All rights reserved.
  4. // Version=4.42
  5.  
  6. // Warning:Do not modify this file.It is generated by RoboHELPÆ and changes will be overwritten.
  7.  
  8.  
  9.  
  10. //Begin the definition of CAgencyXXXX classes
  11.  
  12. //Begin of the CAgencyShow definition
  13. function CAgencyShow( element, bIsShow )
  14. {
  15.     this.ele = element;
  16.     this.bIsShow = bIsShow;
  17. }
  18.  
  19. CAgencyShow.prototype.PrepareEffect = function()
  20. {
  21.     CCSSP.ShowObject( this.ele, !this.bIsShow );
  22. }
  23.  
  24. CAgencyShow.prototype.UpdateEffect = function()
  25. {
  26.     CCSSP.ShowObject( this.ele, this.bIsShow );
  27. }
  28.  
  29. CAgencyShow.prototype.EndEffect = function()
  30. {
  31.     CCSSP.ShowObject( this.ele, !this.bIsShow );
  32. }
  33. // End of the CAgencyShow definition
  34.  
  35. // Begin of CAgencyFly definition
  36. function CAgencyFly( element, settings, bIsIn )
  37. {
  38.     this.ele = element;
  39.     this.bIsIn = bIsIn;
  40.     this.duration = 1000; // default
  41.     this.direction = "right";
  42.  
  43.     var arrAllSet = settings.split(",");
  44.     for( var i = 0; i < arrAllSet.length; i ++ )
  45.     {// to retrieve the setting
  46.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  47.         var arrOneSet = arrAllSet[i].split("=");
  48.         for( var j = 0; j < arrOneSet.length; j++ )
  49.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  50.         switch( arrOneSet[0] )
  51.         {
  52.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  53.         case "direction" : this.direction = arrOneSet[1]; break;
  54.         }
  55.     }
  56.         
  57.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  58.         this.ele.style.position = "relative";
  59.     this.timer = null;
  60.     this.aniIndex = CEngine.arrAnimation.length;
  61.     CEngine.arrAnimation[this.aniIndex] = this;
  62. }
  63.  
  64. CAgencyFly.prototype.PrepareEffect = function()
  65. {
  66.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  67. }
  68.  
  69. CAgencyFly.prototype.UpdateEffect = function()
  70. {
  71.     if( this.timer == null )
  72.         this.ResetParameters();
  73.  
  74.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  75.     if( percent >= 1.0 )
  76.         this.EndEffect();
  77.     else
  78.     {
  79.         var newX = this.startX*(1.0-percent) +  this.finalX*percent;
  80.         var newY = this.startY*(1.0-percent) +  this.finalY*percent;
  81.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  82.         if( this.timer == null )
  83.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  84.     }
  85. }
  86.  
  87. CAgencyFly.prototype.EndEffect = function()
  88. {
  89.     clearInterval( this.timer );
  90.     this.timer = null;
  91.  
  92.     if( this.bIsIn ) // FlyIn
  93.         CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  94.     else // FlyOut
  95.         CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  96.     CCSSP.ShowObject(this.ele, this.bIsIn );
  97. }
  98.  
  99. CAgencyFly.prototype.ResetParameters = function()
  100. {
  101.     this.PrepareEffect();
  102.     CCSSP.ShowObject(this.ele, true );
  103.  
  104.     this.startX = 0;
  105.     this.startY = 0;
  106.     this.finalX = 0;
  107.     this.finalY = 0; 
  108.     
  109.     var offsetLeft = CCSSP.GetObjectWindowLeft(this.ele) + this.ele.offsetWidth;
  110.     var offsetTop = CCSSP.GetObjectWindowTop(this.ele) + this.ele.offsetHeight;
  111.     var offsetRight = CCSSP.GetWindowRight();
  112.     var offsetBottom = CCSSP.GetWindowBottom();
  113.  
  114.     if( this.bIsIn )
  115.     { // FlyIn
  116.         this.finalX = this.ele.ABSX;
  117.         this.finalY = this.ele.ABSY;
  118.  
  119.         switch( this.direction )
  120.         {
  121.         case "right": this.startX = offsetRight; this.startY = this.finalY; break;
  122.         case "left": this.startX = -offsetLeft;  this.startY = this.finalY; break;
  123.         case "down": this.startY = offsetBottom; this.startX = this.finalX; break;
  124.         case "up":  this.startY = -offsetTop;    this.startX = this.finalX; break;
  125.         case "downright":
  126.               this.startX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
  127.             this.startY = this.startX;        break;
  128.         case "upright":
  129.               this.startX = (offsetTop < offsetRight)? offsetTop : offsetRight;
  130.             this.startY = -this.startX;        break;
  131.         case "upleft":
  132.             this.startX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
  133.             this.startY = this.startX;        break;
  134.         case "downleft":
  135.             this.startX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
  136.             this.startY = -this.startX;     break;
  137.         }
  138.     }
  139.     else
  140.     { // FlyOut
  141.         this.startX = this.ele.ABSX;
  142.         this.startY = this.ele.ABSY;
  143.  
  144.         switch( this.direction )
  145.         {
  146.         case "right": this.finalX = offsetRight;  this.finalY = this.startY; break;
  147.         case "left": this.finalX = -offsetLeft;   this.finalY = this.startY;  break;
  148.         case "down": this.finalY = offsetBottom;  this.finalX = this.startX; break;
  149.         case "up":  this.finalY = -offsetTop;     this.finalX = this.startX; break;
  150.         case "downright":
  151.               this.finalX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
  152.             this.finalY = this.finalX;        break;
  153.         case "upright":
  154.               this.finalX = (offsetTop < offsetRight)? offsetTop : offsetRight;
  155.             this.finalY = -this.finalX;        break;
  156.         case "upleft":
  157.             this.finalX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
  158.             this.finalY = this.finalX;        break;
  159.         case "downleft":
  160.             this.finalX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
  161.             this.finalY = -this.finalX;     break;
  162.         }
  163.     }
  164.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  165.     this.startTime = (new Date()).getTime();
  166. }
  167. // End of the CAgencyFly definition
  168.  
  169. // Begin of CAgencySpiral
  170. function CAgencySpiral( element, settings, bIsIn )
  171. {
  172.     this.ele = element;
  173.     this.bIsIn = bIsIn;
  174.     this.duration = 1000; // default
  175.  
  176.     var arrAllSet = settings.split(",");
  177.     for( var i = 0; i < arrAllSet.length; i ++ )
  178.     {// to retrieve the setting
  179.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  180.         var arrOneSet = arrAllSet[i].split("=");
  181.         for( var j = 0; j < arrOneSet.length; j++ )
  182.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  183.         switch( arrOneSet[0] )
  184.         {
  185.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  186.         }
  187.     }
  188.  
  189.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  190.         this.ele.style.position = "relative";
  191.     this.timer = null;
  192.     this.aniIndex = CEngine.arrAnimation.length;
  193.     CEngine.arrAnimation[this.aniIndex] = this;
  194. }
  195.  
  196. CAgencySpiral.prototype.PrepareEffect = function()
  197. {
  198.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  199. }
  200.  
  201. CAgencySpiral.prototype.UpdateEffect = function()
  202. {
  203.     if( this.timer == null )
  204.         this.ResetParameters();
  205.  
  206.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  207.     if( percent >= 1.0 )
  208.         this.EndEffect();
  209.     else
  210.     {
  211.         var rf = (this.bIsIn)? (1.0 - percent) : percent; 
  212.         var t = (1.0-rf) * 4.0 * Math.PI
  213.         var rxP = (this.bIsIn)? this.startX : this.finalX; 
  214.         var ryP = (this.bIsIn)? this.startY : this.finalY; 
  215.         var rx = (Math.abs(rxP) < 200) ? Math.abs(rxP) : 200;
  216.         var ry = (Math.abs(ryP) < 200) ? Math.abs(ryP) : 200;
  217.  
  218.         var newX = Math.ceil(-rf*Math.cos(t)*rx) + this.ele.ABSX;
  219.         var newY = Math.ceil(-rf*Math.sin(t)*ry) + this.ele.ABSY;
  220.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  221.         if( this.timer == null )
  222.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  223.     }
  224. }
  225.  
  226. CAgencySpiral.prototype.EndEffect = function()
  227. {
  228.     clearInterval( this.timer );
  229.     this.timer = null;
  230.     
  231.     if( this.bIsIn ) // In
  232.         CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  233.     else // Out
  234.         CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  235.     CCSSP.ShowObject(this.ele, this.bIsIn );
  236. }
  237.  
  238. CAgencySpiral.prototype.ResetParameters = function()
  239. {
  240.     this.PrepareEffect();
  241.     CCSSP.ShowObject(this.ele, true );
  242.     this.startX = (this.bIsIn)? CCSSP.GetWindowRight() : this.ele.ABSX;
  243.     this.startY = (this.bIsIn)? CCSSP.GetWindowBottom() : this.ele.ABSY;
  244.     this.finalX = (this.bIsIn)? this.ele.ABSX : CCSSP.GetWindowRight();
  245.     this.finalY = (this.bIsIn)? this.ele.ABSY : CCSSP.GetWindowBottom(); 
  246.     
  247.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  248.     this.startTime = (new Date()).getTime();
  249. }
  250. // End of CAgencySpiral
  251.  
  252. // Begin of CAgencyElastic
  253. function CAgencyElastic( element, settings)
  254. {
  255.     this.ele = element;
  256.     this.duration = 1000; // default
  257.     this.direction = "right";
  258.  
  259.     var arrAllSet = settings.split(",");
  260.     for( var i = 0; i < arrAllSet.length; i ++ )
  261.     {// to retrieve the setting
  262.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  263.         var arrOneSet = arrAllSet[i].split("=");
  264.         for( var j = 0; j < arrOneSet.length; j++ )
  265.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  266.         switch( arrOneSet[0] )
  267.         {
  268.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  269.         case "direction" : this.direction = arrOneSet[1]; break;
  270.         }
  271.     }
  272.         
  273.     if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )
  274.         this.ele.style.position = "relative";
  275.     this.timer = null;
  276.     this.aniIndex = CEngine.arrAnimation.length;
  277.     CEngine.arrAnimation[this.aniIndex] = this;
  278. }
  279.  
  280. CAgencyElastic.prototype.PrepareEffect = function()
  281. {
  282.     CCSSP.ShowObject(this.ele, false );
  283. }
  284.  
  285. CAgencyElastic.prototype.UpdateEffect = function()
  286. {
  287.     if( this.timer == null )
  288.         this.ResetParameters();
  289.  
  290.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  291.     if( percent >= 1.0 )
  292.         this.EndEffect();
  293.     else
  294.     {
  295.         var newX = this.startX;
  296.         var newY = this.startY;
  297.         var rf = Math.exp(-percent*3);
  298.         var t = percent * 1.5 * Math.PI
  299.         var rx = (Math.abs(this.startX) > Math.abs(this.startY)) ? this.startX : this.startY;
  300.         switch (this.direction )
  301.         {
  302.         case "left":   
  303.         case "right" : newX = rf*Math.cos(t)*rx + this.ele.ABSX; break;
  304.         case "up":       
  305.         case "down" :  newY = rf*Math.cos(t)*rx + this.ele.ABSX; break;
  306.         }
  307.         CCSSP.MoveObjectTo(this.ele, newX, newY);
  308.         if( this.timer == null )
  309.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  310.     }
  311. }
  312.  
  313. CAgencyElastic.prototype.EndEffect = function()
  314. {
  315.     CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
  316.     clearInterval( this.timer );
  317.     this.timer = null;
  318. }
  319.  
  320. CAgencyElastic.prototype.ResetParameters = function()
  321. {
  322.     CCSSP.ShowObject(this.ele, true );
  323.     this.startX = this.ele.ABSX;
  324.     this.finalX = this.ele.ABSX;
  325.     this.startY = this.ele.ABSY;
  326.     this.finalY = this.ele.ABSY;
  327.     
  328.     switch (this.direction)
  329.     { 
  330.     case "left":  this.startX = -this.ele.offsetWidth; break;
  331.     case "right": this.startX = this.ele.offsetWidth;  break;
  332.     case "up":    this.startY = -this.ele.offsetHeight;break;
  333.     case "down":  this.startY = this.ele.offsetHeight; break;
  334.     }
  335.     CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
  336.     this.startTime = (new Date()).getTime();
  337. }
  338. // End of CAgencyElastic
  339.  
  340. // Begin of CAgencyZoom
  341. function CAgencyZoom( element, settings, bIsIn)
  342. {
  343.     this.ele = element;
  344.     this.duration = 1000; // default
  345.     
  346.     var arrAllSet = settings.split(",");
  347.     for( var i = 0; i < arrAllSet.length; i ++ )
  348.     {// to retrieve the setting
  349.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  350.         var arrOneSet = arrAllSet[i].split("=");
  351.         for( var j = 0; j < arrOneSet.length; j++ )
  352.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  353.         switch( arrOneSet[0] )
  354.         {
  355.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  356.         }
  357.     }
  358.  
  359.     this.bIsIn = bIsIn;
  360.     this.timer = null;
  361.     this.aniIndex = CEngine.arrAnimation.length;
  362.     CEngine.arrAnimation[this.aniIndex] = this;
  363. }
  364.  
  365. CAgencyZoom.prototype.PrepareEffect = function()
  366. {
  367.     CCSSP.ShowObject(this.ele, false);
  368. }
  369.  
  370. CAgencyZoom.prototype.UpdateEffect = function()
  371. {
  372.     if( this.timer == null )
  373.         this.ResetParameters();
  374.  
  375.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  376.     if( percent >= 1.0 )
  377.         this.EndEffect();
  378.     else
  379.     {
  380.         var nFactorIn = Math.ceil(50+50*percent);
  381.         var nFactorOut = Math.ceil(100+200*(1-percent));
  382.         var AlterFontsize = ((this.bIsIn)? nFactorIn : nFactorOut) + "%";
  383.         var AlterFactor = ((this.bIsIn)? nFactorIn : nFactorOut) / 100;
  384.         
  385.         this.UpdateEffectAllChildren(this.ele, AlterFontsize, AlterFactor);
  386.         for(var index = 0; index < this.ele.all.length; index++)
  387.             this.UpdateEffectAllChildren(this.ele.all[index], AlterFontsize, AlterFactor);
  388.             
  389.         if( this.timer == null )
  390.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  391.     }
  392. }
  393.  
  394. CAgencyZoom.prototype.UpdateEffectAllChildren = function(child, FontSize, Factor)
  395. {
  396.     if( CCSSP.IsTextTag(child) )
  397.         child.style.fontSize = FontSize;
  398.     else
  399.     {
  400.         if( typeof(child.orgWidth) == "number" )
  401.             child.style.width = Factor * child.orgWidth;
  402.         if( typeof(child.orgHeight) == "number" )
  403.             child.style.height = Factor * child.orgHeight;
  404.     }
  405. }
  406.  
  407. CAgencyZoom.prototype.EndEffect = function()
  408. {
  409.     this.EndEffectAllChildren(this.ele);
  410.     for(var index = 0; index < this.ele.all.length; index++)
  411.         this.EndEffectAllChildren(this.ele.all[index]);
  412.     
  413.     clearInterval( this.timer );
  414.     this.timer = null;
  415. }
  416.  
  417. CAgencyZoom.prototype.EndEffectAllChildren = function( child )
  418. {    
  419.     if( CCSSP.IsTextTag(child) )
  420.         child.style.fontSize = child.orgFontSize;
  421.     else
  422.     {
  423.         if( typeof(child.intactWidth) != "undefined" )
  424.         {
  425.             child.width = child.intactWidth;
  426.             child.height = child.intactHeight;
  427.         }
  428.         else if( typeof(child.style.intactPixelWidth) != "undefined" )
  429.         {
  430.             child.style.pixelWidth = child.style.intactPixelWidth;
  431.             child.style.pixelHeight = child.style.intactPixelHeight;
  432.         }
  433.     }
  434. }
  435.  
  436. CAgencyZoom.prototype.ResetParameters = function()
  437. {
  438.     this.PrepareEffect();
  439.     this.ResetParametersAllChildren( this.ele );
  440.     for(var index = 0; index < this.ele.all.length; index++)
  441.         this.ResetParametersAllChildren(this.ele.all[index]);
  442.         
  443.     this.startTime = (new Date()).getTime();
  444. }
  445.  
  446. CAgencyZoom.prototype.ResetParametersAllChildren = function( child )
  447. {
  448.     CCSSP.ShowObject(child, true );
  449.     if( (child.tagName == "DIV") && (child.parentElement.tagName == "TD") )
  450.         child.width = "100%";// if the div is inside a cell of table, we need the this hack
  451.     
  452.     if( CCSSP.IsTextTag(child) )
  453.         child.orgFontSize = child.style.fontSize;
  454.     else
  455.     {
  456.         if( child.width > "" || child.height > "" )
  457.         {
  458.             child.orgWidth = child.intactWidth = child.width;
  459.             child.orgHeight = child.intactHeight = child.height;
  460.         }
  461.         else if( ( typeof(child.orgWidth) != "number" ) && (typeof(child.orgHeight) != "number") )
  462.         {
  463.             child.orgWidth = child.style.intactPixelWidth = child.style.pixelWidth;
  464.             child.orgHeight = child.style.intactPixelHeight = child.style.pixelHeight;
  465.         }
  466.     }
  467. }
  468. // End of CAgencyZoom
  469.  
  470. //// the following effects will use IE's exclusive "filter" function ////
  471. // Begin of CAgencyAlpha definition
  472. function CAgencyAlpha( element, settings, bIsIn )
  473. {// because of "visual filter" style, this won't work in Navigator
  474.     this.ele = element;
  475.     this.bIsIn = bIsIn;
  476.  
  477.     // to set the default value
  478.     this.startOpacity = (this.bIsIn) ? 0 : 100;
  479.     this.endOpacity = (this.bIsIn) ? 100 : 0;
  480.     
  481.     this.duration = 1000; // default
  482.     
  483.     var arrAllSet = settings.split(",");
  484.     for( var i = 0; i < arrAllSet.length; i ++ )
  485.     {// to retrieve the setting
  486.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  487.         var arrOneSet = arrAllSet[i].split("=");
  488.         for( var j = 0; j < arrOneSet.length; j++ )
  489.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  490.         switch( arrOneSet[0] )
  491.         {
  492.         case "speed" : this.duration = 100000/arrOneSet[1]; break;
  493.         }
  494.     }
  495.     
  496.     this.timer = null;
  497.     this.aniIndex = CEngine.arrAnimation.length;
  498.     CEngine.arrAnimation[this.aniIndex] = this;
  499. }
  500.  
  501. CAgencyAlpha.prototype.PrepareEffect = function()
  502. {// to set the visual filter function
  503.     // the visual filter ONLY work when set by "Width and Height" or
  504.     // absolute position for DIV, SPAN and normal tag ( such as p )
  505.     // but, "absolute" cause the following elements overlap, so:
  506.     CCSSP.PrepareFilter( this.ele );
  507.     CCSSP.ShowObject(this.ele, !this.bIsIn );
  508. }
  509.  
  510. CAgencyAlpha.prototype.UpdateEffect = function()
  511. {// to set the visual filter function
  512.     if( this.timer == null )
  513.         this.ResetParameters();
  514.     if( typeof(this.ele.filters.alpha) != "object" )
  515.     {
  516.         this.EndEffect();
  517.         return;
  518.     }
  519.  
  520.     var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  521.     if( percent >= 1.0 )
  522.         this.EndEffect();
  523.     else if( typeof(this.ele.filters.alpha) == "object" )
  524.     {
  525.         this.ele.filters.alpha.opacity = this.startOpacity*(1.0-percent) + this.endOpacity*percent;
  526.         if( this.timer == null )
  527.             this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
  528.     }
  529. }
  530.  
  531. CAgencyAlpha.prototype.EndEffect = function()
  532. {// to remove the visual filter function
  533.     clearInterval( this.timer );
  534.     this.timer = null;
  535.     this.ele.style.filter = "";
  536.     CCSSP.ShowObject(this.ele, this.bIsIn );
  537. }
  538.  
  539. CAgencyAlpha.prototype.ResetParameters = function()
  540. {
  541.     this.PrepareEffect();
  542.     CCSSP.ShowObject(this.ele, true );
  543.     this.ele.style.filter = "alpha(opacity=" + this.startOpacity + ")";
  544.     this.startTime = (new Date()).getTime();
  545. }
  546. // End of the CAgencyAlpha definition
  547.  
  548. // Begin of CAgencyWave definition
  549. function CAgencyWave( element, settings )
  550. {// because of "visual filter" style, this won't work in Navigator
  551.     this.ele = element;
  552.  
  553.     this.duration = 0; // default
  554.     this.strength = 10;
  555.     this.freq = 1;
  556.     this.lightstrength = 1;
  557.     
  558.     var arrAllSet = settings.split(",");
  559.     for( var i = 0; i < arrAllSet.length; i ++ )
  560.     {// to retrieve the setting
  561.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  562.         var arrOneSet = arrAllSet[i].split("=");
  563.         for( var j = 0; j < arrOneSet.length; j++ )
  564.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  565.         switch( arrOneSet[0] )
  566.         {
  567.         case "duration" : this.duration = 100000/arrOneSet[1]; break;
  568.         case "strength" : this.strength = arrOneSet[1]; break;
  569.         case "freq" : this.freq = arrOneSet[1]; break;
  570.         case "lightstrength" : this.lightstrength = arrOneSet[1]; break;
  571.         }
  572.     }
  573.  
  574.     this.timer = null;
  575.     this.aniIndex = CEngine.arrAnimation.length;
  576.     CEngine.arrAnimation[this.aniIndex] = this;
  577. }
  578.  
  579. CAgencyWave.prototype.PrepareEffect = function()
  580. {// to set the visual filter function
  581.     CCSSP.PrepareFilter(this.ele);
  582.  
  583.     CCSSP.ShowObject(this.ele, true );
  584. }
  585.  
  586. CAgencyWave.prototype.UpdateEffect = function()
  587. {// to set the visual filter function
  588.     if( this.timer == null )
  589.         this.ResetParameters();
  590.     if( typeof(this.ele.filters.wave) != "object" )
  591.     {
  592.         this.EndEffect();
  593.         return;
  594.     }
  595.  
  596.     if( this.duration > 0 )
  597.     {
  598.         var percent = ((new Date()).getTime() - this.startTime)/this.duration;
  599.         if( percent >= 1.0 )
  600.         {
  601.             this.EndEffect();
  602.             return;
  603.         }
  604.     }
  605.     
  606.     this.ele.filters.wave.phase += 5;
  607.     this.ele.filters.wave.phase %= 100;
  608.     if( this.timer == null )
  609.         this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 50 );
  610. }
  611.  
  612. CAgencyWave.prototype.EndEffect = function()
  613. {// to remove the visual filter function
  614.     this.ele.style.filter = "";
  615.     clearInterval( this.timer );
  616.     this.timer = null;
  617. }
  618.  
  619. CAgencyWave.prototype.ResetParameters = function()
  620. {
  621.     this.PrepareEffect();
  622.     this.ele.style.filter = "wave(strength=" + this.strength + ",freq=" + 
  623.      this.freq +", lightstrength=" + this.lightstrength +",phase=0);";
  624.     this.startTime = (new Date()).getTime();
  625. }
  626. // End of the CAgencyWave definition
  627.  
  628. // Begin of CAgencyGlow definition
  629. function CAgencyGlow( element, settings )
  630. {// because of "visual filter" style, this won't work in Navigator
  631.     this.ele = element;
  632.  
  633.     // to set the default value
  634.     this.glowColor = "green";
  635.     this.glowStrength = "3";
  636.     
  637.     var arrAllSet = settings.split(",");
  638.     for( var i = 0; i < arrAllSet.length; i ++ )
  639.     {
  640.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  641.         var arrOneSet = arrAllSet[i].split("=");
  642.         for( var j = 0; j < arrOneSet.length; j++ )
  643.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  644.         switch( arrOneSet[0] )
  645.         {
  646.         case "color" : this.glowColor = arrOneSet[1]; break;
  647.         case "strength" : this.glowStrength = arrOneSet[1]; break;
  648.         }
  649.     }
  650. }
  651.  
  652. CAgencyGlow.prototype.PrepareEffect = function()
  653. {
  654.     CCSSP.PrepareFilter(this.ele);
  655.     CCSSP.ShowObject(this.ele, true );
  656.     if( this.ele.style.backgroundColor != "" )
  657.     {//style.backgroundColor somehow stop the visual filter
  658.         this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
  659.         this.ele.style.backgroundColor = "";
  660.     }
  661. }
  662.  
  663. CAgencyGlow.prototype.UpdateEffect = function()
  664. {// to set the visual filter function
  665.     this.PrepareEffect();
  666.     this.ele.style.filter = "glow(Color=" + this.glowColor + ", Strength=" + 
  667.         this.glowStrength + ", enabled=true" +")";
  668. }
  669.  
  670. CAgencyGlow.prototype.EndEffect = function()
  671. {// to remove the visual filter function
  672.     this.ele.style.filter = "";
  673.     if( typeof(this.ele.intactBackgroundColor) != "undefined" )
  674.         this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
  675. }
  676. // End of the CAgencyGlow definition
  677.  
  678. // Begin of CAgencyDropShadow definition
  679. function CAgencyDropShadow( element, settings )
  680. {// because of "visual filter" style, this won't work in Navigator
  681.     this.ele = element;
  682.  
  683.     // to set the default value
  684.     this.shadowColor = "black"; 
  685.     this.shadowOffx = "1";
  686.     this.shadowOffy = "1";
  687.     
  688.     var arrAllSet = settings.split(",");
  689.     for( var i = 0; i < arrAllSet.length; i ++ )
  690.     {
  691.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  692.         var arrOneSet = arrAllSet[i].split("=");
  693.         for( var j = 0; j < arrOneSet.length; j++ )
  694.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  695.         switch( arrOneSet[0] )
  696.         {
  697.         case "color" : this.shadowColor = arrOneSet[1]; break;
  698.         case "offx" : this.shadowOffx = arrOneSet[1]; break;
  699.         case "offy" : this.shadowOffy = arrOneSet[1]; break;
  700.         }
  701.     }
  702. }
  703.  
  704. CAgencyDropShadow.prototype.PrepareEffect = function()
  705. {
  706.     CCSSP.PrepareFilter(this.ele);
  707.     CCSSP.ShowObject(this.ele, true );
  708.     
  709.     if( this.ele.style.backgroundColor != "" )
  710.     {//style.backgroundColor somehow stop the visual filter
  711.         this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
  712.         this.ele.style.backgroundColor = "";
  713.     }
  714. }
  715.  
  716. CAgencyDropShadow.prototype.UpdateEffect = function()
  717. {// to set the visual filter function
  718.     this.PrepareEffect();
  719.     this.ele.style.filter = "dropshadow(color=" + this.shadowColor + ", offx=" + 
  720.         this.shadowOffx + ", offy=" + this.shadowOffy + ")";
  721. }
  722.  
  723. CAgencyDropShadow.prototype.EndEffect = function()
  724. {// to remove the visual filter function
  725.     this.ele.style.filter = "";
  726.     if( typeof(this.ele.intactBackgroundColor) != "undefined" )
  727.         this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
  728. }
  729. // End of the CAgencyDropShadow definition
  730.  
  731. // Begin of CAgencyRevealTrans definition
  732. function CAgencyRevealTrans( element, settings )
  733. {// because of "visual filter" style, this won't work in Navigator
  734.     this.ele = element;
  735.  
  736.     // to set the default value
  737.     this.duration = 1.0; //The value is specified in seconds.milliseconds format (0.0000).
  738.     this.transition = 0;
  739.     
  740.     var arrAllSet = settings.split(",");
  741.     for( var i = 0; i < arrAllSet.length; i ++ )
  742.     {
  743.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  744.         var arrOneSet = arrAllSet[i].split("=");
  745.         for( var j = 0; j < arrOneSet.length; j++ )
  746.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  747.         switch( arrOneSet[0] )
  748.         {
  749.         case "type" : this.transition = arrOneSet[1]; break;
  750.         case "duration" : this.duration = 100/arrOneSet[1];    break;
  751.         }
  752.     }
  753. }
  754.  
  755. CAgencyRevealTrans.prototype.PrepareEffect = function()
  756. {
  757.     CCSSP.PrepareFilter(this.ele);
  758.     CCSSP.ShowObject( this.ele, false);
  759. }
  760.  
  761. CAgencyRevealTrans.prototype.UpdateEffect = function()
  762. {// to set the visual filter function
  763.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  764.     {
  765.         if( this.ele.filters.RevealTrans.status == 2 )
  766.             this.ele.filters.RevealTrans.stop();  
  767.     }
  768.  
  769.     this.PrepareEffect();
  770.     
  771.     this.ele.style.filter = "RevealTrans(duration=" + this.duration + 
  772.         ", transition=" + this.transition + ")";
  773.     
  774.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  775.     {
  776.         this.ele.filters.RevealTrans.apply();
  777.         CCSSP.ShowObject( this.ele, true);
  778.         this.ele.filters.RevealTrans.play();  
  779.     }
  780.     else
  781.         CCSSP.ShowObject( this.ele, true);
  782. }
  783.  
  784. CAgencyRevealTrans.prototype.EndEffect = function()
  785. {
  786.     if( typeof( this.ele.filters.RevealTrans ) == "object" )
  787.         this.ele.filters.RevealTrans.stop();  
  788.     this.ele.style.filter = "";
  789. }
  790. // End of the CAgencyRevealTrans definition
  791.  
  792. // Begin of CAgencyBlur definition
  793. function CAgencyBlur( element, settings )
  794. {// because of "visual filter" style, this won't work in Navigator
  795.     this.ele = element;
  796.  
  797.     // to set the default value
  798.     this.strength = "5";
  799.     this.direction = "90";
  800.     
  801.     var arrAllSet = settings.split(",");
  802.     for( var i = 0; i < arrAllSet.length; i ++ )
  803.     {
  804.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  805.         var arrOneSet = arrAllSet[i].split("=");
  806.         for( var j = 0; j < arrOneSet.length; j++ )
  807.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  808.         switch( arrOneSet[0] )
  809.         {
  810.         case "strength" : this.strength = arrOneSet[1]; break;
  811.         case "direction" : this.direction = arrOneSet[1]; break;
  812.         }
  813.     }
  814. }
  815.  
  816. CAgencyBlur.prototype.PrepareEffect = function()
  817. {
  818.     CCSSP.PrepareFilter(this.ele);
  819.     CCSSP.ShowObject(this.ele, true );
  820. }
  821.  
  822. CAgencyBlur.prototype.UpdateEffect = function()
  823. {// to set the visual filter function
  824.     CCSSP.PrepareFilter(this.ele);
  825.     this.ele.style.filter = "blur(strength=" + this.strength + 
  826.         ", direction=" + this.direction + ")";
  827. }
  828.  
  829. CAgencyBlur.prototype.EndEffect = function()
  830. {// to remove the visual filter function
  831.     this.ele.style.filter = "";
  832. }
  833. // End of the CAgencyBlur definition
  834.  
  835. // Begin of CAgencyChangeFilter definition
  836. function CAgencyChangeFilter( element, settings ) // flipH, flipV, invert, grey,
  837. {// because of "visual filter" style, this won't work in Navigator
  838.     this.ele = element;
  839.  
  840.     // to set the default value
  841.     this.filterFunction = settings;
  842. }
  843.  
  844. CAgencyChangeFilter.prototype.PrepareEffect = function()
  845. {
  846.     CCSSP.PrepareFilter(this.ele);
  847.     CCSSP.ShowObject(this.ele, true );
  848. }
  849.  
  850. CAgencyChangeFilter.prototype.UpdateEffect = function()
  851. {// to set the visual filter function
  852.     CCSSP.PrepareFilter(this.ele);
  853.     this.ele.style.filter = this.filterFunction;
  854. }
  855.  
  856. CAgencyChangeFilter.prototype.EndEffect = function()
  857. {// to remove the visual filter function
  858.     this.ele.style.filter = "";
  859. }
  860. // End of the CAgencyChangeFilter definition
  861.  
  862. // The effects below change the style on the fly, so they won't work in Navigator
  863.  
  864. // Begin of CAgencyFontChange definition, 
  865. function CAgencyFontChange( element, settings )
  866. {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
  867.     this.ele = element;
  868.     
  869.     // to retrieve the original font style
  870.     this.RetrieveOldFont( this.ele );
  871.     
  872.     // to set the default font to change
  873.     this.newfontFamily = this.ele.oldFontFamily;
  874.     this.newfColor = this.ele.oldColor;
  875.     this.newtextDecoration = this.ele.oldTextDecoration;
  876.     this.newfontWeight = this.ele.oldFontWeight;
  877.     this.newfontStyle = this.ele.oldFontStyle;
  878.     this.newfontSize = this.ele.oldFontSize;
  879.     this.newBackgroundColor = this.ele.oldBackgroundColor;
  880.     
  881.     var arrAllSet = settings.split(",");
  882.     for( var i = 0; i < arrAllSet.length; i ++ )
  883.     {// to retrieve the setting
  884.         arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
  885.         var arrOneSet = arrAllSet[i].split("=");
  886.         for( var j = 0; j < arrOneSet.length; j++ )
  887.             arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
  888.         switch( arrOneSet[0] )
  889.         {
  890.         case "font-family" : this.newfontFamily = arrOneSet[1]; break;
  891.         case "color" : this.newfColor = arrOneSet[1]; break;
  892.         case "underline" : this.newtextDecoration = (arrOneSet[1]=="on")? "underline" : "none"; break;
  893.         case "bold" : this.newfontWeight = (arrOneSet[1]=="on")? "bold" : "normal"; break;
  894.         case "italic" : this.newfontStyle = (arrOneSet[1]=="on")? "italic" : "normal"; break;
  895.         case "size" : this.newfontSize = arrOneSet[1]; break;
  896.         case "background-color" : this.newBackgroundColor = arrOneSet[1]; break;
  897.         }
  898.     }
  899. }
  900.  
  901. CAgencyFontChange.prototype.RetrieveOldFont = function(objChild)
  902. {
  903.     if( typeof(objChild.oldFontFamily) == "undefined" )
  904.         objChild.oldFontFamily = objChild.style.fontFamily;
  905.     if( typeof(objChild.oldColor) == "undefined" )
  906.         objChild.oldColor = objChild.style.color;
  907.     if( typeof(objChild.oldTextDecoration) == "undefined" )
  908.         objChild.oldTextDecoration = objChild.style.textDecoration;
  909.     if( typeof(objChild.oldFontWeight) == "undefined" )
  910.         objChild.oldFontWeight = objChild.style.fontWeight;
  911.     if( typeof(objChild.oldFontStyle) == "undefined" )
  912.         objChild.oldFontStyle = objChild.style.fontStyle;
  913.     if( typeof(objChild.oldFontSize) == "undefined" )
  914.         objChild.oldFontSize = objChild.style.fontSize;
  915.     if( typeof(objChild.oldBackgroundColor) == "undefined" )
  916.         objChild.oldBackgroundColor = objChild.style.backgroundColor;
  917. }
  918.  
  919. CAgencyFontChange.prototype.PrepareEffect = function()
  920. {
  921.     // as for expanding text, the child is created after the constructor called
  922.     for(var index = 0; index < this.ele.all.length; index++)
  923.         this.RetrieveOldFont(this.ele.all[index]);
  924.     CCSSP.ShowObject(this.ele, true );
  925. }
  926.  
  927. CAgencyFontChange.prototype.UpdateEffect = function()
  928. {// to change the font
  929.     this.PrepareEffect();
  930.     this.UpdateEffectAllChildren( this.ele );
  931.     for( var index = 0; index < this.ele.all.length; index++)
  932.         this.UpdateEffectAllChildren(this.ele.all[index]);
  933. }
  934.  
  935. CAgencyFontChange.prototype.UpdateEffectAllChildren = function(objChild)
  936. {
  937.     objChild.style.fontFamily = this.newfontFamily;
  938.     objChild.style.color = this.newfColor;
  939.     objChild.style.textDecoration = this.newtextDecoration;
  940.     objChild.style.fontWeight = this.newfontWeight;
  941.     objChild.style.fontStyle = this.newfontStyle;
  942.     objChild.style.fontSize = this.newfontSize;
  943.     objChild.style.backgroundColor = this.newBackgroundColor;
  944. }
  945.  
  946. CAgencyFontChange.prototype.EndEffect = function()
  947. {// to reinstate the original font style
  948.     this.EndEffectAllChildren( this.ele );
  949.     for( var index = 0; index < this.ele.all.length; index++)
  950.         this.EndEffectAllChildren(this.ele.all[index]);
  951. }
  952.  
  953. CAgencyFontChange.prototype.EndEffectAllChildren = function( objChild )
  954. {
  955.     if( typeof(objChild.oldFontFamily) != "undefined" )
  956.         objChild.style.fontFamily = objChild.oldFontFamily;
  957.     if( typeof(objChild.oldColor) != "undefined" )
  958.         objChild.style.color = objChild.oldColor;
  959.     if( typeof(objChild.oldFontWeight) != "undefined" )
  960.         objChild.style.fontWeight = objChild.oldFontWeight;
  961.     if( typeof(objChild.oldFontStyle) != "undefined" )
  962.         objChild.style.fontStyle = objChild.oldFontStyle;
  963.     if( typeof(objChild.oldFontSize) != "undefined" )
  964.         objChild.style.fontSize = objChild.oldFontSize;
  965.     if( typeof(objChild.oldTextDecoration) != "undefined" )
  966.         objChild.style.textDecoration = objChild.oldTextDecoration;
  967.     if( typeof(objChild.oldBackgroundColor) != "undefined" )
  968.         objChild.style.backgroundColor = objChild.oldBackgroundColor;
  969. }
  970. // End of the CAgencyFontChange definition
  971.  
  972. // Begin of the CAgencyChangeStyle definition
  973. function CAgencyChangeStyle( element, settings )
  974. {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
  975.     this.ele = element;
  976.     
  977.     // to retrieve the original style
  978.     this.oldstyle = this.ele.style.cssText;
  979.     
  980.     // to set the default style
  981.     this.newStyle = this.oldstyle;
  982.     
  983.     if( typeof(settings) == "string" && settings.length > 1 )
  984.         this.newStyle = this.oldstyle + " " + settings;
  985. }
  986.  
  987. CAgencyChangeStyle.prototype.PrepareEffect = function()
  988. {
  989.     CCSSP.ShowObject(this.ele, true );
  990. }
  991.  
  992. CAgencyChangeStyle.prototype.UpdateEffect = function()
  993. {// to change the style
  994.     this.ele.style.cssText = this.newStyle;
  995. }
  996.  
  997. CAgencyChangeStyle.prototype.EndEffect = function()
  998. {// to reinstate the original style
  999.     this.ele.style.cssText = this.oldStyle;
  1000. }
  1001. // End of the CAgencyChangeStyle definition
  1002.  
  1003. //End the definition of CAgencyXXXX classes
  1004.  
  1005. //Begin to collaborate with other event handler settings 
  1006. CCSSP.RegisterEventHandler( window, "onload", "CEngine.OnPageLoad();BSSCOnLoad();kadovInitTriggersInHead();");
  1007. CCSSP.RegisterEventHandler( document, "onclick", "CEngine.OnPageClick();BSSCOnClick();");
  1008. CCSSP.RegisterEventHandler( document, "onmouseover", "CEngine.OnMouseOver();BSSCOnMouseOver();" );
  1009. CCSSP.RegisterEventHandler( document, "onmouseout", "CEngine.OnMouseOver();BSSCOnMouseOut();" );
  1010. CCSSP.RegisterEventHandler( window, "onunload", "BSSCOnUnload();");
  1011. //End to collaborate with other event handler settings
  1012.  
  1013.  
  1014. /// Section End  - CCSSP DHTM 2 (JavaScript 1.2)
  1015.  
  1016. //// Segment End -- (JavaScript 1.2)
  1017.